
public class Room {
	
	private int x; //location in room array
	private int y; //location in room array
	private int width;
	private int height;
	private int isConnected = 0;
	private boolean hallN;
	private boolean hallW;
	private boolean hallS;
	private boolean hallE;
	private int maxWidth = 10;
	private int maxHeight = 10;
	private Tile[][] tiles;

	public Room(int x, int y) {
		this.x = x;
		this.y = y;
		tiles = new Tile[maxWidth][maxHeight];
		for(int i = 0; i < maxWidth; i++) {
			for(int j = 0; j < maxHeight; j++) {
				tiles[i][j] = new Tile(i, j, true);
			}
		}
	}
	
	public int getIsConnected() {
		return isConnected;
	}

	public void setIsConnected(int isConnected) {
		this.isConnected = isConnected;
	}

	public void createRoom(int width, int height) {
		this.width = width;
		this.height = height;
		for(int i = (maxWidth-width)/2; i < width+(maxWidth-width)/2; i++) {
			for(int j = (maxHeight-height)/2; j < height+(maxHeight-height)/2; j++) {
				tiles[i][j].setWall(false);
			}
		}
	}

	public void createHallwayNorth() {
		for(int j = 0; j < (maxHeight/2)+(height/2); j++) {
			tiles[maxWidth/2-1][j].setWall(false);
		}
		hallN = true;
		isConnected++;
	}
	
	public void createHallwayWest() {
		for(int i = 0; i < (maxWidth/2)+(width/2); i++) {
			tiles[i][maxHeight/2-1].setWall(false);
		}
		hallW = true;
		isConnected++;
	}
	
	public void createHallwaySouth() {
		for(int j = maxHeight-1; j > (maxHeight/2)-(height/2); j--) {
			tiles[maxWidth/2-1][j].setWall(false);
		}
		hallS = true;
		isConnected++;
	}
	
	public void createHallwayEast() {
		for(int i = maxWidth-1; i > (maxWidth/2)-(width/2); i--) {
			tiles[i][maxHeight/2-1].setWall(false);
		}
		hallE = true;
		isConnected++;
	}
	
	public Tile[][] getTiles() {
		return tiles;
	}

	public int getX() {
		return x;
	}

	public int getY() {
		return y;
	}
	
	public boolean isHallN() {
		return hallN;
	}

	public boolean isHallW() {
		return hallW;
	}

	public boolean isHallS() {
		return hallS;
	}

	public boolean isHallE() {
		return hallE;
	}

	public int getWidth() {
		return width;
	}

	public int getHeight() {
		return height;
	}

	public int getMaxWidth() {
		return maxWidth;
	}

	public int getMaxHeight() {
		return maxHeight;
	}
	
	
}
